package com.huawei.appgallery.assistantdock.gamemode.card;

import android.content.Context;
import android.view.View;
import com.huawei.appgallery.foundation.ui.framework.cardkit.bean.CardBean;
import com.huawei.hmf.orb.exception.ConnectRemoteException;
import o.beo$d;
import o.beo.f;
import o.bgj;
import o.bif.d;
import o.biu;
import o.cgz;
import o.Logger;
import o.eyb;
import o.ffa;
import o.ffd;
import o.ffp;
import o.fho;
import o.fho.b;
import o.fhz;

public class GameDeviceEnterCardBuoy extends BuoyBaseEnterCard {
    public GameDeviceEnterCardBuoy(Context context) {
        super(context);
    }

    public cgz ˏ(View view) {
        cgz ˏ = super.ˏ(view);
        this.ˊ.setText(f.ᐝ);
        this.ʼ.setBackgroundResource(beo$d.ʾ);
        return ˏ;
    }

    public void ˏ(CardBean cardBean) {
        ˋ(biu.ˋ().ॱˊ());
        super.ˏ(cardBean);
        ॱˊ();
    }

    public void ˋ() {
        ˏ("CLICK");
        new bgj().ˏ(this.ʼॱ);
    }

    private void ॱˊ() {
        final ffa o_ffp = new ffp(this.ʼॱ, "com.huawei.gameassistant");
        fho.ˋ(o_ffp, new b(this) {
            final /* synthetic */ GameDeviceEnterCardBuoy ˊ;

            public void ˏ(ffd o_ffd, ConnectRemoteException connectRemoteException) {
                if (connectRemoteException != null) {
                    Logger.e("GameDeviceEnterCardBuoy", "connect exception");
                    return;
                }
                fhz ˋ = o_ffd.ˋ("buoysettingmodule");
                if (ˋ == null) {
                    Logger.e("GameDeviceEnterCardBuoy", "Module buoysettingmodule can not be found");
                    return;
                }
                eyb o_eyb = (eyb) ˋ.ॱ(eyb.class);
                if (o_eyb == null) {
                    Logger.e("GameDeviceEnterCardBuoy", "buoyWindowManager is null");
                    return;
                }
                try {
                    if (o_eyb.ˏ()) {
                        this.ˊ.ˋ(true);
                        biu.ˋ().ˎ(true);
                        this.ˊ.ˊ();
                    } else {
                        if (Logger.ˎ()) {
                            Logger.ˏ("GameDeviceEnterCardBuoy", "not support game device");
                        }
                        this.ˊ.ˋ(false);
                        biu.ˋ().ˎ(false);
                        this.ˊ.ˊ();
                    }
                } catch (Exception e) {
                    Logger.e("GameDeviceEnterCardBuoy", "buoyWindowManager not support GameDevice check");
                }
                o_ffp.ॱ();
            }
        });
    }

    String ᐝ() {
        return d.GSS_DEVICE_SETTING.ˊ();
    }
}
